Skip to content

Add redis-best-practices skill - #61

Merged
CahidArda merged 3 commits into
mainfrom
redis-best-practices
Nov 9, 2026
Merged

CahidArda merged 3 commits into
mainfrom
redis-best-practices

Conversation

@joschan21

@joschan21 joschan21 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Adds redis-best-practices, a skill of performance and scale rules for anyone running Redis: open source, Valkey, managed services or Upstash. It starts from the support team's list and is checked against real databases.

What's in it

Also lists the skill in the README and skills.sh.json, adds a pointer from upstash-redis-js, and regenerates skills/upstash.

It's the first skill in this repo without the upstash- prefix. That's deliberate, because its audience is everyone using Redis.

Where the skill differs from the support list

Measurements changed these rules:

  • SCAN with MATCH: the list says MATCH walks every key. That holds on stock Redis and for leading wildcards on Upstash, but a fixed prefix on Upstash found 100 keys among 1 million in 1 page and 2 ms.
  • Script cost: the list says a read-modify-write script costs one command. The billing docs count 1 plus one per redis.call, so a GET and a SET count as 3.
  • Egress example: 400 KiB at 12 M reads a day works out to about 134 TiB a month, not the listed 107 TB, so the skill says "over 100 TB".
  • Customer name: the list's reference to a named customer is left out.

Upstash engine behaviour to check

Measured, and undocumented or at odds with the docs:

  • XRANGE key - + returns at most 1,000 entries with no error. The XRANGE docs say it reads the whole stream.
  • Scripts are killed at about 250 ms, on Pay as You Go and on free scratch databases. No limit is published, and writes made before the kill stay.
  • KEYS fails above about 5,000 results, and for any pattern once the database holds about 100,000 keys.
  • allow-key-locking protects unrelated keys on Pay as You Go, but changed nothing on a free scratch database.
  • A 1 million field hash stalled for 9.4 s repeatedly on a scratch database, and for 566 ms once on Pay as You Go. The cause isn't confirmed.

Not in this PR

No plugin version bump, since recent bumps shipped as their own PR. Plugin users get the skill at the next one.

Test plan

  • npm run check passes on the committed tree
  • All five article links return 200
  • Numbers in the skill match the test runs on stock Redis and Pay as You Go

Adds a skill of Redis performance and scale rules, based on real support
cases and measured on an Upstash Redis Pay as You Go database, free scratch
databases and stock Redis 8. It covers cache vs store, batching, key and value
size, TTLs, commands, scripts, connections and operations, and explains the
Upstash errors an agent is likely to hit.

Five rules link to knowledge base articles that show the measurements.

Also lists the skill in the README and skills.sh.json, points
upstash-redis-js at it, and regenerates skills/upstash.
Renames upstash-redis-best-practices to redis-best-practices, so it serves
anyone running Redis rather than only Upstash users. Every rule stays. Rules
now apply to any deployment and carry stock Redis measurements alongside
Upstash ones, and what only applies to Upstash moves to its own section.

Adds stock Redis guidance on eviction defaults, hot keys, cluster slots, BUSY,
script eviction, the replication backlog and the INFO fields to watch, plus a
table of common errors.
@joschan21 joschan21 changed the title Add upstash-redis-best-practices skill Add redis-best-practices skill Nov 2, 2026
Scripts take a global lock on Upstash unless they use allow-key-locking.
Open source Redis and Valkey reject the flag, so scope it to Upstash and
add the error. Stop narrowing the Upstash test engine to Pay as You Go.
@CahidArda
CahidArda merged commit 39710bd into main Nov 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants